home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
bbs
/
log_date.zip
/
LOG-DATE.DOC
< prev
next >
Wrap
Text File
|
1992-11-11
|
7KB
|
140 lines
Log-Date version 1.0
Compiled 11/11/92
Written By Leon McClatchey
Sysop of The Twilight Zone
316-241-0459 (9600 v.32/v.42bis)
316-241-0499 (300-2400 Hayes)
Log-Date is a handy little utility which was written to help to
automate the task of archiving the logs. I wrote it originally to
help me to automate the task of automatically archiving the
Activity logs for Wildcat at the end of the month, but then while
I was in the process of writing it, I decided to make it a bit
more universal so I could use the same program to date and
archive all of the logs that I maintain on my system. To this
end, all of my logs have one of three extensions tacked on to the
end of the files. The Wildcat Orientated logs all end in .00? in
which the last number denotes what node the log is used on. (I
only run 3 nodes, but there may be bigger boards that runs over
10 nodes, but the syntax would be the same regardless. The other
two extensions are .Log and .Use. There are probably other
extensions, but these are the only ones that I used, so these are
the ones that this particular version will process.
Now, lets get on to how to execute the program. All the options
are done directly from the command line. (I intended to set this
up for Batch File usage so I wanted to keep it as simple as
possible). The Syntax for the command is:
LOG-DATE filename(no extension) <switches>
This program is only meant to handle logs, and so the extensions
will be ignored, and it will only search for specific extensions
within the directory. Yep, you've got it, you have got to change
to the directory of the log you wish date for archiving purposes
as the pathname will probably cause the program to error out, but
then there is a reason for that as you will see a little bit
further in this document.
Now, for the switches. There are only three, and they must be
preceded by "/" before you give the letter. and they are:
/D Daily Date Processing
/W Weekly Date Processing
/M Monthly Date Processing
If you leave off the switches, the program will default to
monthly date processing. These switches are really self
explanatory. The Daily Date Processing will cause a dated copy to
be created on a daily basis. The name of the copied log will be:
FLmmddyy.* F: Represents the first letter of the
old name.
L: Represents the last letter of the old
name.
mm: Represents the month the copy was
made.
dd: Represents the Day the copy was made.
yy: Represents the Year the copy was
made.
Simple huh, but wait, the plot thickens. Especially as we move on
to discuss what weekly date processing entails! First off all,
the program will check what the date is, and if it is not the
last day of the week (or Saturday for you novices out there), it
will not process the file. But if it does process the file, then
it creates yet a different style of filenaming! And this is what
that will look like!
???wwyyW.* ???: The first three letters of the old
name.
ww: Which week of the year it is.
yy: The year of the process.
W: Letter to denote weekly processing.
Are ya still with us? Well, great, now we can take a look at how
the monthly date processing is done! As far as processing goes,
yep, you've got it! If it is not the end of the month, the log is
not processed! And it does not matter, it will not default to 30
either. A little routine has been included in the source code to
even test for leap year so that the log will always be processed
on the last day of the month. (Course that may cause some wierd
logs on occasion, cause the logs will always run from the last
day to the second to the last day instead of the first to the
"31"! But there is yet another twist! And its all in the name!
????mmyy.* ????: The first four letters of the old
name.
mm: The month in which the log was
processed.
yy: The year in which the log was
processed.
Well, I think that about covers the switches. Of course by now
you've noticed that I haven't said anything about the "*" or
extension. For a very good reason. The extension will always be
the same as that of the original file. That is the reason I put
in a little clause to test for specific files within the
directory. The log I was testing this on was the log for Dataview
which happens to follow the same nomenclature of wildcat. But,
the executable and configuration files also has the name of
"DATAVIEW" and so if I let it be a indescriminate dating utility,
it would also make copies of those files. I didn't want that and
so I locked it out!
Now, there are a couple more areas to cover before we close this
thing! When Log-Date runs, it will create two files if any
processing done. The first will be a log in the current directory
that will list what process was done, the date it was done and
the time of execution. Each time it is successfully run, it will
add a line to the log. A sample log has been included in this zip
package to give you an idea of the format of the log.
Another little file will also be created, but this will be a
zero-byte file which you can test for the existence of in a batch
file and execute a set of commands if it is there.
The log file will be named, yep;
Log-Date.Log
and the Run file will be called:
Log-Date.run
Can you see the similarity here? All ya need to do is to remember
to use "log-date.RUN" for the Batch Test and "LOG-DATE.log" for
future reference as to what was done and when. These two files
will be created in every directory that the program is run. I set
it up like that so I could keep track of when the Telemate logs
were archived, the Door Logs, and the Wildcat Logs.
Well, I guess that about covers it! If you have any questions or
would like to leave us some feedback about the utility, I can be
reached at the BBS and Number at the beginning of this document.
I will tell you that I will not offer any guarantees (Had to put
that in, see it in all the software that I've got online). Could
put a beg notice in, but why bother. If you like it use it, if ya
don't, trash it! If ya want something added to the next version,
the number is up above. So I guess that about covers it!